package ua.kpi.oblamskyiv.testcase.answer;

public class Answer implements Comparable<Answer> {
    private String value;

    public Answer(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    @Override
    public String toString() {
        return value;
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (obj == this) {
            return true;
        }
        if (!(obj instanceof Answer)) {
            return false;
        }
        Answer answer = (Answer) obj;
        return value.equals(answer.value);
    }

    public int hashCode() {
        return value.hashCode();
    }

    @Override
    public int compareTo(Answer o) {
        return value.compareTo(o.getValue());
    }
}
